package cn.risebd.wechat.pay.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import cn.risebd.wechat.pay.support.WepaySupport;
import cn.risebd.wepay.model.refund.RefundApplyResponse;

/**
 * @category 退款
 * @author 喝咖啡的蚂蚁
 * @copyright risebd.cn
 *
 */
@RestController
@RequestMapping("/refunds")
public class Refunds {

	@Autowired
	private WepaySupport wepaySupport;

	/**
	 * 退款申请
	 * 
	 * @param orderNumber
	 *            商户订单号
	 */
	@RequestMapping("/apply")
	@ResponseBody
	public RefundApplyResponse apply(@RequestParam("orderNumber") String orderNumber) {
		return wepaySupport.refundApply(orderNumber);
	}
}
